﻿<documents created="2010-12-15 11:42:59Z"><document src="C:\Users\Anders\Documents\automatones\Visual Studio\AutomaTones\AutomaTones\Model\MIDI\Mappers\SampleTranslator.cs" renderPrefix="s0"><chunk hits="-1" domain="unknown"><source><![CDATA[using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Midi;
using AutomaTones.Model.Automaton_Model;
using Microsoft.Pex.Framework;

namespace AutomaTones.Model.MIDI.Mappers
{
    [PexClass]
    partial class SampleTranslator : IMapper
    {
        private readonly List<NoteOut> _notes = new List<NoteOut>();
        int counter = 0;

        [PexMethod]
        public List<NoteOut> Translate(State[,] grid)
        ]]></source>
</chunk>
<method name="Translate" namespace="AutomaTones.Model.MIDI.Mappers" type="AutomaTones.Model.MIDI.Mappers.SampleTranslator" typeName="SampleTranslator" token="60000bd" module="AutomaTones.exe"><hits><hit index="0" value="1"/>
<hit index="1" value="1"/>
<hit index="3" value="1"/>
<hit index="4" value="1"/>
<hit index="5" value="1"/>
<hit index="6" value="1"/>
<hit index="7" value="1"/>
<hit index="8" value="2"/>
<hit index="9" value="1"/>
<hit index="83" value="1"/>
<hit index="84" value="1"/>
<hit index="85" value="1"/>
<hit index="86" value="1"/>
<hit index="102" value="1"/>
<hit index="103" value="1"/>
<hit index="110" value="1"/>
</hits>
<coverage domain="userortestcode" unit="block" covered="5" total="35" coveredRatio="0.14285714285714285"/>
</method>
<chunk hits="1" offset="0000" domain="userortestcode"><source><![CDATA[{]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[
            ]]></source>
</chunk>
<chunk hits="1" offset="0001" domain="userortestcode"><source><![CDATA[Random random = new Random();]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[
            ]]></source>
</chunk>
<chunk hits="1" offset="0007" domain="userortestcode"><source><![CDATA[_notes.Clear();]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[
            ]]></source>
</chunk>
<chunk hits="3" offset="0013" domain="userortestcode"><source><![CDATA[if (counter > 12)]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[ ]]></source>
</chunk>
<chunk hits="0" offset="0029" domain="userortestcode"><source><![CDATA[{]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[
                for (]]></source>
</chunk>
<chunk hits="0" offset="002a" domain="userortestcode"><source><![CDATA[int x = 0;]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[ ]]></source>
</chunk>
<chunk hits="0" offset="0128" domain="userortestcode"><source><![CDATA[x < grid.GetLength(0)]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[; ]]></source>
</chunk>
<chunk hits="0" offset="0124" domain="userortestcode"><source><![CDATA[x++]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[)
                    for (]]></source>
</chunk>
<chunk hits="0" offset="0031" domain="userortestcode"><source><![CDATA[int y = 0;]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[ ]]></source>
</chunk>
<chunk hits="0" offset="0111" domain="userortestcode"><source><![CDATA[y < grid.GetLength(1)]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[; ]]></source>
</chunk>
<chunk hits="0" offset="010d" domain="userortestcode"><source><![CDATA[y++]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[)
                        ]]></source>
</chunk>
<chunk hits="0" offset="0038" domain="userortestcode"><source><![CDATA[if (grid[x, y].CurrentState > 0)]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[
                        ]]></source>
</chunk>
<chunk hits="0" offset="0054" domain="userortestcode"><source><![CDATA[{]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[
                            ]]></source>
</chunk>
<chunk hits="0" offset="0055" domain="userortestcode"><source><![CDATA[if (grid[x, y].CurrentState == 1)]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[
                            ]]></source>
</chunk>
<chunk hits="0" offset="006e" domain="userortestcode"><source><![CDATA[{]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[
                                ]]></source>
</chunk>
<chunk hits="0" offset="006f" domain="userortestcode"><source><![CDATA[_notes.Add(new NoteOut(Pitch.G0, random.Next(128)));]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[
                                ]]></source>
</chunk>
<chunk hits="0" offset="008f" domain="userortestcode"><source><![CDATA[break;]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[
                            }
                            ]]></source>
</chunk>
<chunk hits="0" offset="0094" domain="userortestcode"><source><![CDATA[if (grid[x, y].CurrentState == 3)]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[
                            ]]></source>
</chunk>
<chunk hits="0" offset="00ad" domain="userortestcode"><source><![CDATA[{]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[
                                ]]></source>
</chunk>
<chunk hits="0" offset="00ae" domain="userortestcode"><source><![CDATA[_notes.Add(new NoteOut(Pitch.G0, random.Next(128)));]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[
                                ]]></source>
</chunk>
<chunk hits="0" offset="00ce" domain="userortestcode"><source><![CDATA[break;]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[
                            }
                            ]]></source>
</chunk>
<chunk hits="0" offset="00d0" domain="userortestcode"><source><![CDATA[if (grid[x, y].CurrentState == 5)]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[
                            ]]></source>
</chunk>
<chunk hits="0" offset="00e9" domain="userortestcode"><source><![CDATA[{]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[
                                ]]></source>
</chunk>
<chunk hits="0" offset="00ea" domain="userortestcode"><source><![CDATA[_notes.Add(new NoteOut(Pitch.G0, random.Next(128)));]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[
                                ]]></source>
</chunk>
<chunk hits="0" offset="010a" domain="userortestcode"><source><![CDATA[break;]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[
                            }
                        ]]></source>
</chunk>
<chunk hits="0" offset="010c" domain="userortestcode"><source><![CDATA[}]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[
            ]]></source>
</chunk>
<chunk hits="0" offset="013b" domain="userortestcode"><source><![CDATA[}]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[
            ]]></source>
</chunk>
<chunk hits="1" offset="013c" domain="userortestcode"><source><![CDATA[counter++;]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[
            ]]></source>
</chunk>
<chunk hits="2" offset="014a" domain="userortestcode"><source><![CDATA[if (counter == 15)]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[ ]]></source>
</chunk>
<chunk hits="0" offset="015d" domain="userortestcode"><source><![CDATA[{]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[
                ]]></source>
</chunk>
<chunk hits="0" offset="015e" domain="userortestcode"><source><![CDATA[counter = 0;]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[
                ]]></source>
</chunk>
<chunk hits="0" offset="0165" domain="userortestcode"><source><![CDATA[_notes.Add(new NoteOut(Pitch.A3, 0, 30, random.Next(128)));]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[
            ]]></source>
</chunk>
<chunk hits="0" offset="0186" domain="userortestcode"><source><![CDATA[}]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[
            ]]></source>
</chunk>
<chunk hits="1" offset="0187" domain="userortestcode"><source><![CDATA[return _notes;]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[
        ]]></source>
</chunk>
<chunk hits="1" offset="0190" domain="userortestcode"><source><![CDATA[}]]></source>
</chunk>
<chunk hits="-1" domain="unknown"><source><![CDATA[
    }
}
]]></source>
</chunk>
</document>
</documents>
